/*
 * @Descripttion: 
 * @Author: chendingfengmail@163.com
 * @version: 
 * @Date: 2021-06-22 14:21:53
 * @LastEditors: chendingfengmail@163.com
 * @LastEditTime: 2022-01-10 15:42:14
 */

import { request } from '../service'
const file = {
  /**
   * @description 文件下载
   * @param {Object} params
   */
  fileDownload(params) {
    return request({
      url: `/file/file/download`,
      method: 'get',
      params: params
    })
  },

  /**
   * @description 获取上传进度
   * @param {Object} params
   */
  fileProgress(params) {
    return request({
      url: `/file/file/progress`,
      method: 'post',
      params: params
    })
  },

  /**
   * @description 文件上传
   * @param {Object} params
   */
  fileUpload(params) {
    params.append("day", -1)
    return request({
      url: `/file/file/upload`,
      method: 'post',
      headers: { 'Content-Type': 'multipart/form-data' },
      data: params
    })
  },

  /**
   * @description 通过文件ID获取文件列表
   * @param {Object} idList 以逗号分隔的文件id列表
   */
  findByIdList(idList) {
    return request({
      url: `/file/file/findByIdList`,
      method: 'get',
      params: idList
    })
  },
}

export default file;
